package com.doge.controller.wx;

import com.doge.bean.base.BaseData;
import com.doge.bean.base.BaseRespVo;
import com.doge.bean.bo.aftersale.AftersaleSubmitBO;
import com.doge.bean.vo.wxaftersale.WxAftersaleDetail;
import com.doge.service.wx.aftersale.WxAftersaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: project2-wechat-mall
 * @description:
 * @author: 305905917@qq.com
 * @create: 2021-12-03 22:39
 **/

@RestController
@RequestMapping("wx/aftersale")
public class WxAfterSaleController {

    @Autowired
    WxAftersaleService wxAftersaleService;


    //显示售后的回显
    @RequestMapping("list")
    public BaseRespVo list(Integer status, Integer page, Integer limit) {
        BaseData baseData = wxAftersaleService.list(status,page,limit);
        return BaseRespVo.ok(baseData);
    }


    //显示售后详情
    @RequestMapping("detail")
    public BaseRespVo detail(Integer orderId) {
        WxAftersaleDetail wxAftersaleDetail = wxAftersaleService.detail(orderId);
        return BaseRespVo.ok(wxAftersaleDetail);
    }



    @RequestMapping("submit")
    public BaseRespVo submit(@RequestBody AftersaleSubmitBO aftersaleSubmitBO){


        wxAftersaleService.submit(aftersaleSubmitBO);

        return BaseRespVo.ok();
    }

}
